
/**
** \file       exec_caseitem.c
**
** \brief      this function execute caseitem rule
**
** \author     Ben M'rad Hanna, Laterem Hamza, Boillot Ulysse ,De Olivera
**             Guillaume and Nguyen Viet Dung
**
** \version    0.8
**
** \date       23 November 2010
**
*/

#include "execution.h"

int             exec_caseitem(s_caseitem                *node)
{
  s_caseitem    *tmp_caseitem = NULL;
  s_word        *tmp_word = NULL;

  tmp_caseitem = node;

  while (tmp_caseitem != NULL)
  {
    tmp_word = tmp_caseitem->word;

    while (tmp_word != NULL)
    {
      if (tmp_word->word == NULL)
        return (1);
      tmp_word = tmp_word->next;
    }

    if (exec_cmpdlist(tmp_caseitem->cmpdlist) != 0)
      return (1);

    tmp_caseitem = tmp_caseitem->next;
  }
  return (0);
}

